home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-01 | 33.6 KB | 1,359 lines | [TEXT/MPS ] |
- ;
- ; File: CMApplication.a
- ;
- ; Contains: Color Matching Interfaces
- ;
- ; Version: Technology: ColorSync 2.0
- ; Release: Universal Interfaces 3.0d3 on Copland DR1
- ;
- ; Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
- ;
- ; Bugs?: If you find a problem with this file, send the file and version
- ; information (from above) and the problem description to:
- ;
- ; Internet: apple.bugs@applelink.apple.com
- ; AppleLink: APPLE.BUGS
- ;
- ;
- IF &TYPE('__CMAPPLICATION__') = 'UNDEFINED' THEN
- __CMAPPLICATION__ SET 1
-
- IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
- include 'Types.a'
- ENDIF
- IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
- include 'Quickdraw.a'
- ENDIF
- IF &TYPE('__FILES__') = 'UNDEFINED' THEN
- include 'Files.a'
- ENDIF
- IF &TYPE('__PRINTING__') = 'UNDEFINED' THEN
- include 'Printing.a'
- ENDIF
- IF &TYPE('__CMICCPROFILE__') = 'UNDEFINED' THEN
- include 'CMICCProfile.a'
- ENDIF
- IF FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE THEN
-
- kDefaultCMMSignature EQU 'appl'
- ; Macintosh 68K trap word
-
- cmTrap EQU $ABEE
- ; PicComment IDs
-
- cmBeginProfile EQU 220
- cmEndProfile EQU 221
- cmEnableMatching EQU 222
- cmDisableMatching EQU 223
- cmComment EQU 224
- ; PicComment selectors for cmComment
-
- cmBeginProfileSel EQU 0
- cmContinueProfileSel EQU 1
- cmEndProfileSel EQU 2
- ; Defines for version 1.0 CMProfileSearchRecord.fieldMask
-
- cmMatchCMMType EQU $00000001
- cmMatchApplProfileVersion EQU $00000002
- cmMatchDataType EQU $00000004
- cmMatchDeviceType EQU $00000008
- cmMatchDeviceManufacturer EQU $00000010
- cmMatchDeviceModel EQU $00000020
- cmMatchDeviceAttributes EQU $00000040
- cmMatchFlags EQU $00000080
- cmMatchOptions EQU $00000100
- cmMatchWhite EQU $00000200
- cmMatchBlack EQU $00000400
- ; Defines for version 2.0 CMSearchRecord.searchMask
-
- cmMatchAnyProfile EQU $00000000
- cmMatchProfileCMMType EQU $00000001
- cmMatchProfileClass EQU $00000002
- cmMatchDataColorSpace EQU $00000004
- cmMatchProfileConnectionSpace EQU $00000008
- cmMatchManufacturer EQU $00000010
- cmMatchModel EQU $00000020
- cmMatchAttributes EQU $00000040
- cmMatchProfileFlags EQU $00000080
- ; Result codes
-
- ; General Errors
- cmProfileError EQU -170
- cmMethodError EQU -171
- cmMethodNotFound EQU -175 ; CMM not present
- cmProfileNotFound EQU -176 ; Responder error
- cmProfilesIdentical EQU -177 ; Profiles the same
- cmCantConcatenateError EQU -178 ; Profile can't be concatenated
- cmCantXYZ EQU -179 ; CMM cant handle XYZ space
- cmCantDeleteProfile EQU -180 ; Responder error
- cmUnsupportedDataType EQU -181 ; Responder error
- cmNoCurrentProfile EQU -182 ; Responder error
- ; Profile Access Errors
- cmElementTagNotFound EQU -4200
- cmIndexRangeErr EQU -4201 ; Index out of range
- cmCantDeleteElement EQU -4202
- cmFatalProfileErr EQU -4203
- cmInvalidProfile EQU -4204 ; A Profile must contain a 'cs1 ' tag to be valid
- cmInvalidProfileLocation EQU -4205 ; Operation not supported for this profile location
- ; Profile Search Errors
- cmInvalidSearch EQU -4206 ; Bad Search Handle
- cmSearchError EQU -4207
- cmErrIncompatibleProfile EQU -4208 ; Other ColorSync Errors
- cmInvalidColorSpace EQU -4209 ; Profile colorspace does not match bitmap type
- cmInvalidSrcMap EQU -4210 ; Source pix/bit map was invalid
- cmInvalidDstMap EQU -4211 ; Destination pix/bit map was invalid
- cmNoGDevicesError EQU -4212 ; Begin/End Matching -- no gdevices available
- cmInvalidProfileComment EQU -4213 ; Bad Profile comment during drawpicture
- ; Color Conversion Errors
- cmRangeOverFlow EQU -4214 ; Warning that some output color values over/underflowed and were clipped
- ; Other Profile Access Errors
- cmCantCopyModifiedV1Profile EQU -4215 ; Illegal to copy version 1 profiles that have been modified
- ; NamedColor Errors
- cmNamedColorNotFound EQU -4216 ; namedColor not found
- ; deviceType values for ColorSync 1.0 Device Profile access
-
- cmSystemDevice EQU 'sys '
- cmGDevice EQU 'gdev'
- ; Commands for CMFlattenUPP(…)
-
- cmOpenReadSpool EQU 1
- cmOpenWriteSpool EQU 2
- cmReadSpool EQU 3
- cmWriteSpool EQU 4
- cmCloseSpool EQU 5
- ; Flags for PostScript-related functions
-
- cmPS7bit EQU 1
- cmPS8bit EQU 2
- ; Caller-supplied flatten function
- ; Caller-supplied progress function for Bitmap & PixMap matching routines
- ; Caller-supplied filter function for Profile search
- ; typedef long CMError
-
- ; For 1.0 and 2.0 profile header variants
- ; CMAppleProfileHeader
- CMAppleProfileHeader RECORD 0
- cm1 ds CMHeader ; offset: $0 (0)
- ORG 0
- cm2 ds CM2Header ; offset: $0 (0)
- sizeof EQU * ; size: $80 (128)
- ENDR
- ; Param for CWConcatColorWorld(…)
- CMConcatProfileSet RECORD 0
- keyIndex ds.w 1 ; offset: $0 (0) ; Zero-based
- count ds.w 1 ; offset: $2 (2) ; Min 1
- profileSet ds.l 1 ; offset: $4 (4) <-- really an array of length one ; Variable. Ordered from Source -> Dest
- sizeof EQU * ; size: $8 (8)
- ENDR
- ; ColorSync color data types
- CMRGBColor RECORD 0
- red ds.w 1 ; offset: $0 (0) ; 0..65535
- green ds.w 1 ; offset: $2 (2)
- blue ds.w 1 ; offset: $4 (4)
- sizeof EQU * ; size: $6 (6)
- ENDR
- CMCMYKColor RECORD 0
- cyan ds.w 1 ; offset: $0 (0) ; 0..65535
- magenta ds.w 1 ; offset: $2 (2)
- yellow ds.w 1 ; offset: $4 (4)
- black ds.w 1 ; offset: $6 (6)
- sizeof EQU * ; size: $8 (8)
- ENDR
- CMCMYColor RECORD 0
- cyan ds.w 1 ; offset: $0 (0) ; 0..65535
- magenta ds.w 1 ; offset: $2 (2)
- yellow ds.w 1 ; offset: $4 (4)
- sizeof EQU * ; size: $6 (6)
- ENDR
- CMHLSColor RECORD 0
- hue ds.w 1 ; offset: $0 (0) ; 0..65535. Fraction of circle. Red at 0
- lightness ds.w 1 ; offset: $2 (2) ; 0..65535
- saturation ds.w 1 ; offset: $4 (4) ; 0..65535
- sizeof EQU * ; size: $6 (6)
- ENDR
- CMHSVColor RECORD 0
- hue ds.w 1 ; offset: $0 (0) ; 0..65535. Fraction of circle. Red at 0
- saturation ds.w 1 ; offset: $2 (2) ; 0..65535
- value ds.w 1 ; offset: $4 (4) ; 0..65535
- sizeof EQU * ; size: $6 (6)
- ENDR
- CMLabColor RECORD 0
- L ds.w 1 ; offset: $0 (0) ; 0..65535 maps to 0..100
- a ds.w 1 ; offset: $2 (2) ; 0..65535 maps to -128..127.996
- b ds.w 1 ; offset: $4 (4) ; 0..65535 maps to -128..127.996
- sizeof EQU * ; size: $6 (6)
- ENDR
- CMLuvColor RECORD 0
- L ds.w 1 ; offset: $0 (0) ; 0..65535 maps to 0..100
- u ds.w 1 ; offset: $2 (2) ; 0..65535 maps to -128..127.996
- v ds.w 1 ; offset: $4 (4) ; 0..65535 maps to -128..127.996
- sizeof EQU * ; size: $6 (6)
- ENDR
- CMYxyColor RECORD 0
- capY ds.w 1 ; offset: $0 (0) ; 0..65535 maps to 0..1
- x ds.w 1 ; offset: $2 (2) ; 0..65535 maps to 0..1
- y ds.w 1 ; offset: $4 (4) ; 0..65535 maps to 0..1
- sizeof EQU * ; size: $6 (6)
- ENDR
- CMGrayColor RECORD 0
- gray ds.w 1 ; offset: $0 (0) ; 0..65535
- sizeof EQU * ; size: $2 (2)
- ENDR
- CMMultichannel5Color RECORD 0
- components ds.b 5 ; offset: $0 (0) ; 0..255
- ORG 6
- sizeof EQU * ; size: $6 (6)
- ENDR
- CMMultichannel6Color RECORD 0
- components ds.b 6 ; offset: $0 (0) ; 0..255
- sizeof EQU * ; size: $6 (6)
- ENDR
- CMMultichannel7Color RECORD 0
- components ds.b 7 ; offset: $0 (0) ; 0..255
- ORG 8
- sizeof EQU * ; size: $8 (8)
- ENDR
- CMMultichannel8Color RECORD 0
- components ds.b 8 ; offset: $0 (0) ; 0..255
- sizeof EQU * ; size: $8 (8)
- ENDR
- CMNamedColor RECORD 0
- namedColorIndex ds.l 1 ; offset: $0 (0) ; 0..a lot
- sizeof EQU * ; size: $4 (4)
- ENDR
- CMColor RECORD 0
- rgb ds CMRGBColor ; offset: $0 (0)
- ORG 0
- hsv ds CMHSVColor ; offset: $0 (0)
- ORG 0
- hls ds CMHLSColor ; offset: $0 (0)
- ORG 0
- XYZ ds CMXYZColor ; offset: $0 (0)
- ORG 0
- Lab ds CMLabColor ; offset: $0 (0)
- ORG 0
- Luv ds CMLuvColor ; offset: $0 (0)
- ORG 0
- Yxy ds CMYxyColor ; offset: $0 (0)
- ORG 0
- cmyk ds CMCMYKColor ; offset: $0 (0)
- ORG 0
- cmy ds CMCMYColor ; offset: $0 (0)
- ORG 0
- gray ds CMGrayColor ; offset: $0 (0)
- ORG 0
- mc5 ds CMMultichannel5Color ; offset: $0 (0)
- ORG 0
- mc6 ds CMMultichannel6Color ; offset: $0 (0)
- ORG 0
- mc7 ds CMMultichannel7Color ; offset: $0 (0)
- ORG 0
- mc8 ds CMMultichannel8Color ; offset: $0 (0)
- ORG 0
- namedColor ds CMNamedColor ; offset: $0 (0)
- ORG 8
- sizeof EQU * ; size: $8 (8)
- ENDR
- CMProfileSearchRecord RECORD 0
- header ds CMHeader ; offset: $0 (0)
- fieldMask ds.l 1 ; offset: $40 (64)
- reserved ds.l 2 ; offset: $44 (68)
- sizeof EQU * ; size: $4C (76)
- ENDR
- ; typedef struct CMProfileSearchRecord * CMProfileSearchRecordPtr
-
- ; typedef CMProfileSearchRecordPtr * CMProfileSearchRecordHandle
-
- ; Search definition for 2.0
- CMSearchRecord RECORD 0
- CMMType ds.l 1 ; offset: $0 (0)
- profileClass ds.l 1 ; offset: $4 (4)
- dataColorSpace ds.l 1 ; offset: $8 (8)
- profileConnectionSpace ds.l 1 ; offset: $C (12)
- deviceManufacturer ds.l 1 ; offset: $10 (16)
- deviceModel ds.l 1 ; offset: $14 (20)
- deviceAttributes ds.l 2 ; offset: $18 (24)
- profileFlags ds.l 1 ; offset: $20 (32)
- searchMask ds.l 1 ; offset: $24 (36)
- filter ds.l 1 ; offset: $28 (40)
- sizeof EQU * ; size: $2C (44)
- ENDR
- ; GetCWInfo structures
- CMMInfoRecord RECORD 0
- CMMType ds.l 1 ; offset: $0 (0)
- CMMVersion ds.l 1 ; offset: $4 (4)
- sizeof EQU * ; size: $8 (8)
- ENDR
- CMCWInfoRecord RECORD 0
- cmmCount ds.l 1 ; offset: $0 (0)
- cmmInfo ds.b 2 * CMMInfoRecord.sizeof ; offset: $4 (4)
- sizeof EQU * ; size: $14 (20)
- ENDR
-
- cmNoColorPacking EQU $0000
- cmAlphaSpace EQU $0080
- cmWord5ColorPacking EQU $0500
- cmLong8ColorPacking EQU $0800
- cmLong10ColorPacking EQU $0A00
- cmAlphaFirstPacking EQU $1000
- cmOneBitDirectPacking EQU $0B00
-
- cmNoSpace EQU 0
- cmRGBSpace EQU 1
- cmCMYKSpace EQU 2
- cmHSVSpace EQU 3
- cmHLSSpace EQU 4
- cmYXYSpace EQU 5
- cmXYZSpace EQU 6
- cmLUVSpace EQU 7
- cmLABSpace EQU 8
- cmReservedSpace1 EQU 9
- cmGraySpace EQU 10
- cmReservedSpace2 EQU 11
- cmGamutResultSpace EQU 12
- cmRGBASpace EQU 129
- cmGrayASpace EQU 138
- cmRGB16Space EQU $0501
- cmRGB32Space EQU $0801
- cmARGB32Space EQU $1881
- cmCMYK32Space EQU $0802
- cmHSV32Space EQU $0A03
- cmHLS32Space EQU $0A04
- cmYXY32Space EQU $0A05
- cmXYZ32Space EQU $0A06
- cmLUV32Space EQU $0A07
- cmLAB32Space EQU $0A08
- cmGamutResult1Space EQU $0B0C
- ; typedef unsigned long CMBitmapColorSpace
-
- CMBitmap RECORD 0
- image ds.l 1 ; offset: $0 (0)
- width ds.l 1 ; offset: $4 (4)
- height ds.l 1 ; offset: $8 (8)
- rowBytes ds.l 1 ; offset: $C (12)
- pixelSize ds.l 1 ; offset: $10 (16)
- space ds.l 1 ; offset: $14 (20)
- user1 ds.l 1 ; offset: $18 (24)
- user2 ds.l 1 ; offset: $1C (28)
- sizeof EQU * ; size: $20 (32)
- ENDR
- ; Classic Print Manager Stuff
-
- enableColorMatchingOp EQU 12
- registerProfileOp EQU 13
-
- cmNoProfileBase EQU 0
- cmFileBasedProfile EQU 1
- cmHandleBasedProfile EQU 2
- cmPtrBasedProfile EQU 3
- CMFileLocation RECORD 0
- spec ds FSSpec ; offset: $0 (0)
- sizeof EQU * ; size: $46 (70)
- ENDR
- CMHandleLocation RECORD 0
- h ds.l 1 ; offset: $0 (0)
- sizeof EQU * ; size: $4 (4)
- ENDR
- CMPtrLocation RECORD 0
- p ds.l 1 ; offset: $0 (0)
- sizeof EQU * ; size: $4 (4)
- ENDR
- CMProfLoc RECORD 0
- fileLoc ds CMFileLocation ; offset: $0 (0)
- ORG 0
- handleLoc ds CMHandleLocation ; offset: $0 (0)
- ORG 0
- ptrLoc ds CMPtrLocation ; offset: $0 (0)
- ORG 70
- sizeof EQU * ; size: $46 (70)
- ENDR
- CMProfileLocation RECORD 0
- locType ds.w 1 ; offset: $0 (0)
- u ds CMProfLoc ; offset: $2 (2)
- sizeof EQU * ; size: $48 (72)
- ENDR
- ; Profile file and element access
- ;
- ; pascal CMError CMNewProfile(CMProfileRef *prof, const CMProfileLocation *theProfile)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMNewProfile
- move.l #$0008001B,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMNewProfile
- ENDIF
-
- ;
- ; pascal CMError CMOpenProfile(CMProfileRef *prof, const CMProfileLocation *theProfile)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMOpenProfile
- move.l #$0008001C,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMOpenProfile
- ENDIF
-
- ;
- ; pascal CMError CMCloseProfile(CMProfileRef prof)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMCloseProfile
- move.l #$0004001D,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMCloseProfile
- ENDIF
-
- ;
- ; pascal CMError CMUpdateProfile(CMProfileRef prof)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMUpdateProfile
- move.l #$00040034,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMUpdateProfile
- ENDIF
-
- ;
- ; pascal CMError CMCopyProfile(CMProfileRef *targetProf, const CMProfileLocation *targetLocation, CMProfileRef srcProf)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMCopyProfile
- move.l #$000C0025,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMCopyProfile
- ENDIF
-
- ;
- ; pascal CMError CMValidateProfile(CMProfileRef prof, Boolean *valid, Boolean *preferredCMMnotfound)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMValidateProfile
- move.l #$000C0026,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMValidateProfile
- ENDIF
-
- ;
- ; pascal CMError CMGetProfileLocation(CMProfileRef prof, CMProfileLocation *theProfile)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMGetProfileLocation
- move.l #$0008003C,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMGetProfileLocation
- ENDIF
-
- ;
- ; pascal CMError CMFlattenProfile(CMProfileRef prof, unsigned long flags, CMFlattenUPP proc, void *refCon, Boolean *preferredCMMnotfound)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMFlattenProfile
- move.l #$00140031,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMFlattenProfile
- ENDIF
-
- ;
- ; pascal CMError CMUnflattenProfile(FSSpec *resultFileSpec, CMFlattenUPP proc, void *refCon, Boolean *preferredCMMnotfound)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMUnflattenProfile
- move.l #$00100032,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMUnflattenProfile
- ENDIF
-
- ;
- ; pascal CMError CMGetProfileHeader(CMProfileRef prof, CMAppleProfileHeader *header)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMGetProfileHeader
- move.l #$00080039,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMGetProfileHeader
- ENDIF
-
- ;
- ; pascal CMError CMSetProfileHeader(CMProfileRef prof, const CMAppleProfileHeader *header)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMSetProfileHeader
- move.l #$0008003A,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMSetProfileHeader
- ENDIF
-
- ;
- ; pascal CMError CMProfileElementExists(CMProfileRef prof, OSType tag, Boolean *found)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMProfileElementExists
- move.l #$000C001E,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMProfileElementExists
- ENDIF
-
- ;
- ; pascal CMError CMCountProfileElements(CMProfileRef prof, unsigned long *elementCount)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMCountProfileElements
- move.l #$0008001F,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMCountProfileElements
- ENDIF
-
- ;
- ; pascal CMError CMGetProfileElement(CMProfileRef prof, OSType tag, unsigned long *elementSize, void *elementData)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMGetProfileElement
- move.l #$00100020,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMGetProfileElement
- ENDIF
-
- ;
- ; pascal CMError CMSetProfileElement(CMProfileRef prof, OSType tag, unsigned long elementSize, void *elementData)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMSetProfileElement
- move.l #$00100023,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMSetProfileElement
- ENDIF
-
- ;
- ; pascal CMError CMSetProfileElementSize(CMProfileRef prof, OSType tag, unsigned long elementSize)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMSetProfileElementSize
- move.l #$000C0038,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMSetProfileElementSize
- ENDIF
-
- ;
- ; pascal CMError CMSetProfileElementReference(CMProfileRef prof, OSType elementTag, OSType referenceTag)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMSetProfileElementReference
- move.l #$000C0035,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMSetProfileElementReference
- ENDIF
-
- ;
- ; pascal CMError CMGetPartialProfileElement(CMProfileRef prof, OSType tag, unsigned long offset, unsigned long *byteCount, void *elementData)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMGetPartialProfileElement
- move.l #$00140036,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMGetPartialProfileElement
- ENDIF
-
- ;
- ; pascal CMError CMSetPartialProfileElement(CMProfileRef prof, OSType tag, unsigned long offset, unsigned long byteCount, void *elementData)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMSetPartialProfileElement
- move.l #$00140037,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMSetPartialProfileElement
- ENDIF
-
- ;
- ; pascal CMError CMGetIndProfileElementInfo(CMProfileRef prof, unsigned long index, OSType *tag, unsigned long *elementSize, Boolean *refs)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMGetIndProfileElementInfo
- move.l #$00140021,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMGetIndProfileElementInfo
- ENDIF
-
- ;
- ; pascal CMError CMGetIndProfileElement(CMProfileRef prof, unsigned long index, unsigned long *elementSize, void *elementData)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMGetIndProfileElement
- move.l #$00100022,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMGetIndProfileElement
- ENDIF
-
- ;
- ; pascal CMError CMRemoveProfileElement(CMProfileRef prof, OSType tag)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMRemoveProfileElement
- move.l #$00080024,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMRemoveProfileElement
- ENDIF
-
- ;
- ; pascal CMError CMGetScriptProfileDescription(CMProfileRef prof, Str255 name, ScriptCode *code)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMGetScriptProfileDescription
- move.l #$000C003E,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMGetScriptProfileDescription
- ENDIF
-
- ; Low-level matching functions
- ;
- ; pascal CMError NCWNewColorWorld(CMWorldRef *cw, CMProfileRef src, CMProfileRef dst)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _NCWNewColorWorld
- move.l #$000C0014,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION NCWNewColorWorld
- ENDIF
-
- ;
- ; pascal CMError CWConcatColorWorld(CMWorldRef *cw, CMConcatProfileSet *profileSet)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CWConcatColorWorld
- move.l #$00080015,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CWConcatColorWorld
- ENDIF
-
- ;
- ; pascal CMError CWNewLinkProfile(CMProfileRef *prof, const CMProfileLocation *targetLocation, CMConcatProfileSet *profileSet)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CWNewLinkProfile
- move.l #$000C0033,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CWNewLinkProfile
- ENDIF
-
- ;
- ; pascal void CWDisposeColorWorld(CMWorldRef cw)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CWDisposeColorWorld
- move.l #$00040001,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CWDisposeColorWorld
- ENDIF
-
- ;
- ; pascal CMError CWMatchColors(CMWorldRef cw, CMColor *myColors, unsigned long count)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CWMatchColors
- move.l #$000C0002,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CWMatchColors
- ENDIF
-
- ;
- ; pascal CMError CWCheckColors(CMWorldRef cw, CMColor *myColors, unsigned long count, long *result)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CWCheckColors
- move.l #$00100003,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CWCheckColors
- ENDIF
-
- ; Bitmap matching
- ;
- ; pascal CMError CWMatchBitmap(CMWorldRef cw, CMBitmap *bitmap, CMBitmapCallBackUPP progressProc, void *refCon, CMBitmap *matchedBitmap)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CWMatchBitmap
- move.l #$0010002C,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CWMatchBitmap
- ENDIF
-
- ;
- ; pascal CMError CWCheckBitmap(CMWorldRef cw, const CMBitmap *bitmap, CMBitmapCallBackUPP progressProc, void *refCon, CMBitmap *resultBitmap)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CWCheckBitmap
- move.l #$0014002D,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CWCheckBitmap
- ENDIF
-
- ; Quickdraw-specific matching
- ;
- ; pascal CMError CWMatchPixMap(CMWorldRef cw, PixMap *myPixMap, CMBitmapCallBackUPP progressProc, void *refCon)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CWMatchPixMap
- move.l #$00100004,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CWMatchPixMap
- ENDIF
-
- ;
- ; pascal CMError CWCheckPixMap(CMWorldRef cw, PixMap *myPixMap, CMBitmapCallBackUPP progressProc, void *refCon, BitMap *resultBitMap)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CWCheckPixMap
- move.l #$00140007,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CWCheckPixMap
- ENDIF
-
- ;
- ; pascal CMError NCMBeginMatching(CMProfileRef src, CMProfileRef dst, CMMatchRef *myRef)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _NCMBeginMatching
- move.l #$000C0016,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION NCMBeginMatching
- ENDIF
-
- ;
- ; pascal void CMEndMatching(CMMatchRef myRef)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMEndMatching
- move.l #$0004000B,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMEndMatching
- ENDIF
-
- ;
- ; pascal void NCMDrawMatchedPicture(PicHandle myPicture, CMProfileRef dst, Rect *myRect)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _NCMDrawMatchedPicture
- move.l #$000C0017,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION NCMDrawMatchedPicture
- ENDIF
-
- ;
- ; pascal void CMEnableMatchingComment(Boolean enableIt)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMEnableMatchingComment
- move.l #$0002000D,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMEnableMatchingComment
- ENDIF
-
- ;
- ; pascal CMError NCMUseProfileComment(CMProfileRef prof, unsigned long flags)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _NCMUseProfileComment
- move.l #$0008003B,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION NCMUseProfileComment
- ENDIF
-
- ; System Profile access
- ;
- ; pascal CMError CMGetSystemProfile(CMProfileRef *prof)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMGetSystemProfile
- move.l #$00040018,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMGetSystemProfile
- ENDIF
-
- ;
- ; pascal CMError CMSetSystemProfile(const FSSpec *profileFileSpec)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMSetSystemProfile
- move.l #$00040019,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMSetSystemProfile
- ENDIF
-
- ; External Profile Management
- ;
- ; pascal CMError CMNewProfileSearch(CMSearchRecord *searchSpec, void *refCon, unsigned long *count, CMProfileSearchRef *searchResult)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMNewProfileSearch
- move.l #$00100027,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMNewProfileSearch
- ENDIF
-
- ;
- ; pascal CMError CMUpdateProfileSearch(CMProfileSearchRef search, void *refCon, unsigned long *count)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMUpdateProfileSearch
- move.l #$000C0028,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMUpdateProfileSearch
- ENDIF
-
- ;
- ; pascal void CMDisposeProfileSearch(CMProfileSearchRef search)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMDisposeProfileSearch
- move.l #$00040029,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMDisposeProfileSearch
- ENDIF
-
- ;
- ; pascal CMError CMSearchGetIndProfile(CMProfileSearchRef search, unsigned long index, CMProfileRef *prof)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMSearchGetIndProfile
- move.l #$000C002A,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMSearchGetIndProfile
- ENDIF
-
- ;
- ; pascal CMError CMSearchGetIndProfileFileSpec(CMProfileSearchRef search, unsigned long index, FSSpec *profileFile)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMSearchGetIndProfileFileSpec
- move.l #$000C002B,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMSearchGetIndProfileFileSpec
- ENDIF
-
- ; Utilities
- ;
- ; pascal CMError CMGetColorSyncFolderSpec(short vRefNum, Boolean createFolder, short *foundVRefNum, long *foundDirID)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMGetColorSyncFolderSpec
- move.l #$000C0011,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMGetColorSyncFolderSpec
- ENDIF
-
- ;
- ; pascal CMError CMGetCWInfo(CMWorldRef cw, CMCWInfoRecord *info)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMGetCWInfo
- move.l #$0008001A,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMGetCWInfo
- ENDIF
-
- ; PS-related
- ;
- ; pascal CMError CMGetPS2ColorSpace(CMProfileRef srcProf, unsigned long flags, CMFlattenUPP proc, void *refCon, Boolean *preferredCMMnotfound)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMGetPS2ColorSpace
- move.l #$0014002E,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMGetPS2ColorSpace
- ENDIF
-
- ;
- ; pascal CMError CMGetPS2ColorRenderingIntent(CMProfileRef srcProf, unsigned long flags, CMFlattenUPP proc, void *refCon, Boolean *preferredCMMnotfound)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMGetPS2ColorRenderingIntent
- move.l #$0014002F,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMGetPS2ColorRenderingIntent
- ENDIF
-
- ;
- ; pascal CMError CMGetPS2ColorRendering(CMProfileRef srcProf, CMProfileRef dstProf, unsigned long flags, CMFlattenUPP proc, void *refCon, Boolean *preferredCMMnotfound)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMGetPS2ColorRendering
- move.l #$00180030,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMGetPS2ColorRendering
- ENDIF
-
- ;
- ; pascal CMError CMGetPS2ColorRenderingVMSize(CMProfileRef srcProf, CMProfileRef dstProf, unsigned long *vmSize, Boolean *preferredCMMnotfound)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMGetPS2ColorRenderingVMSize
- move.l #$0010003D,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMGetPS2ColorRenderingVMSize
- ENDIF
-
- ; ColorSync 1.0 functions which have parallel 2.0 counterparts
- ;
- ; pascal CMError CWNewColorWorld(CMWorldRef *cw, CMProfileHandle src, CMProfileHandle dst)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CWNewColorWorld
- move.l #$000C0000,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CWNewColorWorld
- ENDIF
-
- ;
- ; pascal CMError ConcatenateProfiles(CMProfileHandle thru, CMProfileHandle dst, CMProfileHandle *newDst)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _ConcatenateProfiles
- move.l #$000C000C,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION ConcatenateProfiles
- ENDIF
-
- ;
- ; pascal CMError CMBeginMatching(CMProfileHandle src, CMProfileHandle dst, CMMatchRef *myRef)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMBeginMatching
- move.l #$000C000A,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMBeginMatching
- ENDIF
-
- ;
- ; pascal void CMDrawMatchedPicture(PicHandle myPicture, CMProfileHandle dst, Rect *myRect)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMDrawMatchedPicture
- move.l #$000C0009,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMDrawMatchedPicture
- ENDIF
-
- ;
- ; pascal CMError CMUseProfileComment(CMProfileHandle profile)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMUseProfileComment
- move.l #$00040008,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMUseProfileComment
- ENDIF
-
- ;
- ; pascal void CMGetProfileName(CMProfileHandle myProfile, CMIString *IStringResult)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMGetProfileName
- move.l #$0008000E,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMGetProfileName
- ENDIF
-
- ;
- ; pascal long CMGetProfileAdditionalDataOffset(CMProfileHandle myProfile)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CMGetProfileAdditionalDataOffset
- move.l #$0004000F,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CMGetProfileAdditionalDataOffset
- ENDIF
-
- ; ProfileResponder functions
- ;
- ; pascal CMError GetProfile(OSType deviceType, long refNum, CMProfileHandle aProfile, CMProfileHandle *returnedProfile)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _GetProfile
- move.l #$00100005,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION GetProfile
- ENDIF
-
- ;
- ; pascal CMError SetProfile(OSType deviceType, long refNum, CMProfileHandle newProfile)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _SetProfile
- move.l #$000C0006,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION SetProfile
- ENDIF
-
- ;
- ; pascal CMError SetProfileDescription(OSType deviceType, long refNum, long deviceData, CMProfileHandle hProfile)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _SetProfileDescription
- move.l #$00100010,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION SetProfileDescription
- ENDIF
-
- ;
- ; pascal CMError GetIndexedProfile(OSType deviceType, long refNum, CMProfileSearchRecordHandle search, CMProfileHandle *returnProfile, long *index)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _GetIndexedProfile
- move.l #$00140012,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION GetIndexedProfile
- ENDIF
-
- ;
- ; pascal CMError DeleteDeviceProfile(OSType deviceType, long refNum, CMProfileHandle deleteMe)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _DeleteDeviceProfile
- move.l #$000C0013,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION DeleteDeviceProfile
- ENDIF
-
- IF OLDROUTINENAMES THEN
- ; constants
-
- kMatchCMMType EQU $00000001
- kMatchApplProfileVersion EQU $00000002
- kMatchDataType EQU $00000004
- kMatchDeviceType EQU $00000008
- kMatchDeviceManufacturer EQU $00000010
- kMatchDeviceModel EQU $00000020
- kMatchDeviceAttributes EQU $00000040
- kMatchFlags EQU $00000080
- kMatchOptions EQU $00000100
- kMatchWhite EQU $00000200
- kMatchBlack EQU $00000400
- ; types
- CMYKColor RECORD 0
- f ds CMCMYKColor
- sizeof EQU * ; size: $8 (8)
- ENDR
-
-
- ; typedef CMWorldRef CWorld
-
- ; typedef long * CMGamutResult
-
- ; functions
- ;
- ; pascal void EndMatching(CMMatchRef myRef)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _EndMatching
- move.l #$0004000B,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION EndMatching
- ENDIF
-
- ;
- ; pascal void EnableMatching(Boolean enableIt)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _EnableMatching
- move.l #$0002000D,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION EnableMatching
- ENDIF
-
- ;
- ; pascal CMError GetColorSyncFolderSpec(short vRefNum, Boolean createFolder, short *foundVRefNum, long *foundDirID)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _GetColorSyncFolderSpec
- move.l #$000C0011,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION GetColorSyncFolderSpec
- ENDIF
-
- ;
- ; pascal CMError BeginMatching(CMProfileHandle src, CMProfileHandle dst, CMMatchRef *myRef)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _BeginMatching
- move.l #$000C000A,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION BeginMatching
- ENDIF
-
- ;
- ; pascal void DrawMatchedPicture(PicHandle myPicture, CMProfileHandle dst, Rect *myRect)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _DrawMatchedPicture
- move.l #$000C0009,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION DrawMatchedPicture
- ENDIF
-
- ;
- ; pascal CMError UseProfile(CMProfileHandle profile)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _UseProfile
- move.l #$00040008,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION UseProfile
- ENDIF
-
- ;
- ; pascal void GetProfileName(CMProfileHandle myProfile, CMIString *IStringResult)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _GetProfileName
- move.l #$0008000E,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION GetProfileName
- ENDIF
-
- ;
- ; pascal long GetProfileAdditionalDataOffset(CMProfileHandle myProfile)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _GetProfileAdditionalDataOffset
- move.l #$0004000F,D0
- dc.w $ABEE
- EndM
- ELSE
- IMPORT_CFM_FUNCTION GetProfileAdditionalDataOffset
- ENDIF
-
- ENDIF
- ENDIF
- IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
- ; PrGeneral parameter blocks
- TEnableColorMatchingBlk RECORD 0
- iOpCode ds.w 1 ; offset: $0 (0)
- iError ds.w 1 ; offset: $2 (2)
- lReserved ds.l 1 ; offset: $4 (4)
- hPrint ds.l 1 ; offset: $8 (8)
- fEnableIt ds.b 1 ; offset: $C (12)
- filler ds.b 1 ; offset: $D (13)
- sizeof EQU * ; size: $E (14)
- ENDR
- TRegisterProfileBlk RECORD 0
- iOpCode ds.w 1 ; offset: $0 (0)
- iError ds.w 1 ; offset: $2 (2)
- lReserved ds.l 1 ; offset: $4 (4)
- hPrint ds.l 1 ; offset: $8 (8)
- fRegisterIt ds.b 1 ; offset: $C (12)
- filler ds.b 1 ; offset: $D (13)
- sizeof EQU * ; size: $E (14)
- ENDR
- ENDIF
- ENDIF ; __CMAPPLICATION__
-
-